﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class 入住登记 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void Binddate()
    {
        users us = new users();
        GridView1.DataSource = us.Gets(us);
        GridView1.DataBind();
    }
   
    protected void btnL_Click(object sender, EventArgs e)
    {
        string name = tbx_uname.Text.Trim();
        string number = txtnu.Text.Trim();
        string tel = TextBox3.Text.Trim();
        string te = TextBox5.Text.Trim();
        string pss = TextBox6.Text.Trim();
        string penson = TextBox4.Text.Trim();
        string num = TextBox7.Text.Trim();

        users tmp=new users() ;
        tmp.name=name ;
        tmp.number=number;
        tmp.tel=tel;
        tmp.rte=te;
        tmp.tte=pss;
        tmp.penson =penson ;
        tmp.num =num;

        int result = tmp.ruzhu(tmp);
        if (result > 0)
        {
            Response.Write("<script>alert(\"添加成功！\")</script>");
            Binddate();
        }
       
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}